<template>
  <div>
    <div v-if="!$store.state.whiteUserId.includes(userInfo.id)">
      <el-tabs v-model="activeName" @tab-click="tabChange">
        <el-tab-pane :label="manageName" name="0">
          <accManageList :activeName="activeName" @getCount="getCount"></accManageList>
        </el-tab-pane>
        <el-tab-pane :label="auditName" name="1">
          <accAudit :activeName="activeName" @getAuditCount="getAuditCount"/>
        </el-tab-pane>
      </el-tabs>
    </div>
    
    <div v-else>
        <accAudit activeName="1" @getAuditCount="getAuditCount"/>
    </div>
  </div>
  
</template>

<script>
import accAudit from '../accAudit/index'
import accManageList from './accManageList'
import { getStore } from '@/utils/utils'

export default {
  components: {
    accAudit,
    accManageList
  },
  data () {
      return {
          activeName: '0',
          activeName2: '1',
          manageName: '全部账号',
          auditName: '待审核'
      }
  },
  created() {
    this.userInfo = JSON.parse(getStore('userInfo'))
  },
  methods: {
      tabChange (name) {
        console.log(name, 'name')
      },
      getCount (count) {
          this.manageName = count ? `全部账号（${count}）` : '全部账号'
      },
      getAuditCount (count) {
          this.auditName = count ? `待审核（${count}）` : '待审核'
      }
  }
}
</script>

<style lang="scss" scoped>

</style>
